package com.zheng.shop.common.Enum;

import com.alibaba.fastjson.JSONObject;

/**
 * Created by IntelliJ IDEA.
 * User: xinqi
 * Date: 2017/11/24
 * Time: 14:52
 */
public enum ProductStatusType {
    NORMAL(0, "正常"),
    FREEZE(1, "冻结"),
    DELETED(2, "已删除");
    public int key;

    public String value;

    ProductStatusType(int key, String value) {
        this.key = key;
        this.value = value;
    }
    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static JSONObject getJsonArray(){
        ProductStatusType[] paramTypes = ProductStatusType.values();
        JSONObject param = new JSONObject();
        for(ProductStatusType paramType:paramTypes){
            JSONObject json = new JSONObject();
            json.put("value",paramType.value);
            json.put("key",paramType.key);
            param.put(paramType.toString(),json);
        }
        return param;
    }
}
